package priv.pfz.basedao.lab.dao.sharding;

import priv.pfz.basedao.sharding.ShardingInfo;
import priv.pfz.basedao.sharding.ShardingStrategy;

/**
 * @author yyjxp
 * 2024/2/3 2:16
 */
public class GoodsShardingStrategy implements ShardingStrategy<String> {
    @Override
    public ShardingInfo getShardingInfo(String goodsCode) {
        return ShardingInfo.dbTable(goodsCode.substring(0, 2), goodsCode.substring(2, 4));
    }
}
